e611c520c72e61f44faa25dafa48c849036c84b6,src/main/java/org/springframework/data/gemfire/listener/adapter/ContinuousQueryListenerAdapter.java,MethodInvoker,MethodInvoker,#Object#String#,239
Before Change
methods = new ArrayList<Method>();
ReflectionUtils.doWithMethods(c, new MethodCallback() {
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
ReflectionUtils.makeAccessible(method);
methods.add(method);
}
}, new MethodFilter() {
public boolean matches(Method method) {
if (Modifier.isPublic(method.getModifiers()) && methodName.equals(method.getName())) {
// check out the arguments
Class<?>[] parameterTypes = method.getParameterTypes();
int objects = 0;
int operations = 0;
if (parameterTypes.length > 0) {
for (Class<?> paramType : parameterTypes) {
if (Object.class.equals(paramType)) {
objects++;
if (objects > 2) {
return false;
}
}
else if (Operation.class.equals(paramType)) {
operations++;
if (operations > 2) {
return false;
}
}
else if (CqEvent.class.equals(paramType)) {
}
else if (Throwable.class.equals(paramType)) {
}
else if (byte[].class.equals(paramType)) {
}
else if (CqQuery.class.equals(paramType)) {
}
else {
return false;
}
}
return true;
}
}
return false;
}
});
Assert.isTrue(!methods.isEmpty(), "Cannot find a suitable method named [" + c.getName() + "#" + methodName
+ "] - is the method public and has the proper arguments?");
After Change
this.delegate = delegate;
methods = new ArrayList<Method>();
ReflectionUtils.doWithMethods(c, new MethodCallback() {
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
ReflectionUtils.makeAccessible(method);
methods.add(method);
}
}, new MethodFilter() {
public boolean matches(Method method) {
return isValidEventMethodSignature(method, methodName);
}
});
Assert.isTrue(!methods.isEmpty(), String.format(
"Cannot find a suitable method named [%1$s#%2$s] - is the method public and does it have the proper arguments?",